package cn.ac.zing.server.hj212.handler;

import cn.ac.zing.api.enums.ProtocolTypeEnum;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 设备心跳handler
 * @Author：dcy
 * @name：HeartHandler
 * @Date：2024/5/21 20:40
 */
@Component
@Slf4j
public class HeartHandler implements ProtocolTypeHandler{
    @Override
    public ProtocolTypeEnum getHandlerType() {
        return ProtocolTypeEnum.HEART;
    }

    @Override
    public void execute(JSONObject data) {
        data.put("protocol", ProtocolTypeEnum.HEART.getDesc());
        log.info("心跳数据: {}", data);
        // TODO 处理心跳数据
    }
}
